<?
 class Lib_Router {
    private function getRoute() {
        if (empty($_GET['route']))
       {
           $route = 'index';
	   }
         else
	   {
            $route = $_GET['route'];				
			$rt=explode('/', $route);
            $route=$rt[(count($rt)-1)];
       }
       return $route;
    }
    
    private function getController()
	{       
       $route=$this->getRoute();
	   $path_contr = 'application/controllers/';
       $controller= $path_contr. $route . '.php';
       return $controller;
    }
	 
	public function getView()
	{
       $route=$this->getRoute();
	   $path_view = 'application/views/' ;
       $view = $path_view . $route . '.php';
       return $view;
    }
    
    public function Run() {
        session_start();
        $controller = $this->getController();
        $ctl = explode('.',$controller);
        $ctl = $ctl[0];
        $name_contr=str_replace("/", "_", $ctl);
	   $contr=new $name_contr;
       $contr->index();
	   $member=$contr->member;
	    
		
	   return $member;
        
    }
 }